<?php
function GetSQLValueString($theValue,$theType){

	$theValue = get_magic_quotes_gpc() ? $theValue : addslashes($theValue);
	switch($theType){

		case "text":
			$theValue = ($theValue != "") ? "'".$theValue."'" : "null";
			break;
		case "int":
		 	$theValue = ($theValue != "") ? intval($theValue) : "null";
			break;
		  }
	return $theValue;

}
?>